import { createStore } from 'vuex';

export default createStore({
    state: {
        token: '',
        userInfo: {},
        isLogin: false
    },
    mutations: {
        setToken(state, token) {
            state.token = token;
        },
        setUserInfo(state, userInfo) {
            state.userInfo = userInfo;
        },
        setIsLogin(state, isLogin) {
            state.isLogin = isLogin;
        }
    },
    actions: {
        // 可以添加异步操作
    }
}); 